﻿using IntelligentAgriculture.Contracts.Interface;
using IntelligentAgriculture.WebAPI.Application.Command.AppearanceModelCommand;
using IntelligentAgriculture.WebAPI.Application.Command.BodyMeasureModelCommand;
using IntelligentAgriculture.WebAPI.Application.CommandHandler.BodyMeasureModelCommandHandler;
using MediatR;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.AppearanceModelCommandHandler
{
    public class AppearanceModelDeleteCommandHandler : IRequestHandler<AppearanceModelDeleteCommand, Results<int>>
    {

        private readonly IAppearanceModelService appearanceModelService;
        private readonly ILogger<BodyMeasureModelDeleteCommandHandler> logger;
        public AppearanceModelDeleteCommandHandler(IAppearanceModelService appearanceModelService, ILogger<BodyMeasureModelDeleteCommandHandler> logger)
        {
            this.appearanceModelService = appearanceModelService;
            this.logger = logger;
        }

        public async Task<Results<int>> Handle(AppearanceModelDeleteCommand request, CancellationToken cancellationToken)
        {
            var list = await appearanceModelService.Delete(request.Ids);
            return Results<int>.DataResult(list);
        }



    }





}
